package serviceimpl;

import java.util.List;

import service.IProductService;
import vo.Product;
import dao.IProductDao;

public class ProductService implements IProductService {
	   
	IProductDao  productDao;
    public IProductDao getProductDao() {
		return productDao;
	}
	public void setProductDao(IProductDao productDao) {
		this.productDao = productDao;
	}

		
	    //======1.显示商品=============
	public List getProduct(int page,int rows,String hql) 
	{
		
	  return	productDao.getProduct(page, rows,hql);
	}

	
			//======2.添加商品============
	public void addProduct(Product product){
		 productDao.addProduct(product);
	}
			
			//======3.删除商品============
	public void delProduct(int productId){
		 productDao.delProduct(productId);
		
	}
			
			//======4.编辑商品============
	public void editProduct(Product product){
		 productDao.editProduct(product);
		
	}
			
			//======5.查询商品============
			
			//======6.获得所有的商品数============
	public int getAllProduct(String hql){
		return  productDao.getAllProduct(hql);
	}
	//======7.根据productid获得商品============
		public Product  getProductById(int productid){
			return  productDao.getProductById(productid);
		}
		
}
